package wang.wangby.lazydoc.common.parameter;

import java.lang.reflect.Type;
import java.util.Map;

import wang.wangby.lazydoc.common.DocParameterType;

public class VarType extends DocParameterType {

	private Map<String, Type> realType;
	private Type type;
	
	public VarType(Type type, Type ownerType) {
		super(type, ownerType);
		this.realType=getRealType(ownerType);
		this.type=realType.get(type.getTypeName());
		if(this.type==null) {
			this.type=Object.class;
		}
	}

	@Override
	public String getTypeName() {
		return type.getTypeName();
	}

	@Override
	public Class getRawType() {
		return getRawType(type);
	}

	@Override
	public Class getFirstGenericType() {
		return getRawType(type);
	}

}
